package org.xxpay.apibase.vo.api;

import lombok.Data;
import org.xxpay.apibase.util.StrKit;
import org.xxpay.apibase.vo.ApiPayOrder;

/**
 * 支付查单接口api 实体Bean
 */
@Data
public class PayQueryRes extends AbstractRes {

    /**  **/
    private String mchId;

    /**  **/
    private String appId;

    /**  **/
    private String productId;

    /**  **/
    private String payOrderId;

    /**  **/
    private String mchOrderNo;

    /**  **/
    private String amount;

    /**  **/
    private String currency;

    /**  **/
    private String status;

    /**  **/
    private String channelUser;

    /**  **/
    private String channelOrderNo;

    /**  **/
    private String channelAttach;

    /**  **/
    private String paySuccTime;


    public void setByOrder(ApiPayOrder payOrder){
        this.mchId = StrKit.toString(payOrder.getMchId());
        this.appId = StrKit.toString(payOrder.getAppId());
        this.productId = StrKit.toString(payOrder.getProductId());
        this.payOrderId = StrKit.toString(payOrder.getPayOrderId());
        this.mchOrderNo = StrKit.toString(payOrder.getMchOrderNo());
        this.amount = StrKit.toString(payOrder.getAmount());
        this.currency = StrKit.toString(payOrder.getCurrency());
        this.status = StrKit.toString(payOrder.getStatus());
        this.channelUser = StrKit.toString(payOrder.getChannelUser());
        this.channelOrderNo = StrKit.toString(payOrder.getChannelOrderNo());
        this.channelAttach = "".equals(StrKit.toString(payOrder.getChannelAttach())) ? "" : payOrder.getChannelAttach();
        this.paySuccTime = payOrder.getPaySuccTime() == null ? "" : payOrder.getPaySuccTime().getTime() + "";
    }

}


